package com.foodsafe.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;

/**
 * Goodcategory entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "goodcategory", catalog = "foodsafe")
public class Goodcategory implements java.io.Serializable {

	// Fields

	@Expose
	private Integer goodCategoryId;
	@Expose
	private String goodCategoryName;
	@Expose
	private String goodCategoryDesc;
	@Expose
	private String goodSubCateDesc;
	private Set<Goods> goodses = new HashSet<Goods>(0);

	// Constructors

	/** default constructor */
	public Goodcategory() {
	}

	/** full constructor */
	public Goodcategory(String goodCategoryName, String goodCategoryDesc,
			String goodSubCateDesc, Set<Goods> goodses) {
		this.goodCategoryName = goodCategoryName;
		this.goodCategoryDesc = goodCategoryDesc;
		this.goodSubCateDesc = goodSubCateDesc;
		this.goodses = goodses;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "GoodCategoryId", unique = true, nullable = false)
	public Integer getGoodCategoryId() {
		return this.goodCategoryId;
	}

	public void setGoodCategoryId(Integer goodCategoryId) {
		this.goodCategoryId = goodCategoryId;
	}

	@Column(name = "GoodCategoryName", length = 32)
	public String getGoodCategoryName() {
		return this.goodCategoryName;
	}

	public void setGoodCategoryName(String goodCategoryName) {
		this.goodCategoryName = goodCategoryName;
	}

	@Column(name = "GoodCategoryDesc", length = 256)
	public String getGoodCategoryDesc() {
		return this.goodCategoryDesc;
	}

	public void setGoodCategoryDesc(String goodCategoryDesc) {
		this.goodCategoryDesc = goodCategoryDesc;
	}

	@Column(name = "GoodSubCateDesc", length = 1024)
	public String getGoodSubCateDesc() {
		return this.goodSubCateDesc;
	}

	public void setGoodSubCateDesc(String goodSubCateDesc) {
		this.goodSubCateDesc = goodSubCateDesc;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "goodcategory")
	public Set<Goods> getGoodses() {
		return this.goodses;
	}

	public void setGoodses(Set<Goods> goodses) {
		this.goodses = goodses;
	}

}